package cn.doitedu.demos

import org.apache.spark.sql.SparkSession

object Demo {
  def main(args: Array[String]): Unit = {

    val spark = SparkSession.builder()
      .appName("")
      .master("local[*]")
      .getOrCreate()


    val rdd = spark.sparkContext.parallelize(Seq(("a", 3,6), ("a", 4,7), ("a", 2,8), ("b", 3,9), ("b", 4,2), ("b", 2,3)))
    val value = rdd.sortBy(tp => tp._2)

    value.foreach(tp=>println(tp))


  }

}
